<?php
/**
*  Smarty plugin
* 
* File:     function.in_array.php
* Type:     function
* Name:     in_array
* Purpose:  If in array
* 
*/
function smarty_function_in_array($aParameter, &$smarty)
{
	//fetch all data from $aParameter
	foreach($aParameter as $_key => $_val)
	{
		switch($_key) 
		{
		    case 'key':
		        $sKey = (string)$_val;
		        break;
		    
		    case 'aError':
		        $aError = (array)$_val;
		        break;		  
		        
		    default:
		    	break;
		}
	}

    if (is_array($aError)) 
    {
        if (array_key_exists($sKey,$aError))
    	{
    		echo "1";	
    	}
    	else
    	{
    		echo "0";	
    	}
    }
}
//$t->register_modifier("in_array","smarty_modifier_in_array");
?>
